﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Api.searcher;
using GeekDesk.ViewModel;
using GeekDesk.API;
using GeekDesk.Control.Windows;

namespace GeekDesk.Control.UserControls.Push
{
    /// <summary>
    /// APIControl.xaml 的交互逻辑
    /// </summary>
    public partial class APIControl : UserControl
    {
        private List<Result> results;
        private APISearch ApiSearch;
       
        public APIControl(string s)
        {
            
            InitializeComponent();
            InitialList();
            DataContext = results;
        }

        private void InitialList()
        {
            ApiSearch = new APISearch();
            int length = Math.Min(GetHotPassege.title.Count(), GetHotPassege.content.Count());
            results = ApiSearch.Api(PushBasicWindow.SearchString);
            APIList.ItemsSource = results;
        }

        private void ListBoxItem_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {

        }

       
    }
}
